package com.lvmama.task.common.utils;

import com.lvmama.task.common.vo.Task;

import java.io.Serializable;


public class TaskXmlModel extends Task implements Serializable {

	private static final long serialVersionUID = 8979568736153329937L;

	public static TaskXmlModel createInstance(Task task) {
		
		TaskXmlModel model = new TaskXmlModel();
		model.setTaskName(task.getTaskName());
		model.setWebServiceUrl(task.getWebServiceUrl());
		model.setRequestType(task.getRequestType());
		model.setPlanTime(task.getPlanTime());
		model.setCycle(task.getCycle());
		model.setWeek(task.getWeek());
		model.setStatus(TASK_STATUS.END.toString());//等待
		model.setDescription(task.getDescription());
		model.setAvailable(TASK_AVAILABLE.DISABLE.toString());//停用
		model.setCycleDimension(task.getCycleDimension());
		model.setParameter(task.getParameter());
		model.setCronExpression(task.getCronExpression());
		model.setJobNode(task.getJobNode());
		model.setOwner(task.getOwner());
		model.setSoTimeout(task.getSoTimeout());

		return model;
	}
}
